<?php


namespace App\Utils;


class Helper
{
    static function pow($value)
    {
        if ($value > 0 & $value < 32)
            return 1 << ($value - 1);
        return $value;
    }

    static function flagText($flags, $value)
    {
        $texts = [];
        foreach ($flags as $key => $text) {
            if ($value & (1 << ($key - 1))) {
                $texts[] = $text;
            }
        }
        return implode('、', $texts);
    }
}
